Previous Topic

Next Topic

To create a stored procedure

  1. Select Utilities> SQL Query to open the SQLQuery window.
  2. Click New.
  3. Enter the SQL command in the SQL Command Text field. For example, the following SQL command will create a stored procedure to generate unique, consistent event codes that include the year and event number count:
    CREATE PROCEDURE Meeting_Calc @MeetingCounterName varchar (30) AS

    Declare @MeetingCounter int, @Count int
    select @Count=Count(*) from Counter
    where COUNTER_NAME=@MeetingCounterName
    if @Count=0
    begin
    insert into Counter (COUNTER_NAME,LAST_VALUE)
    values (@MeetingCounterName,1)
    select @MeetingCounter=1
    end
    else
    begin
    update Counter set LAST_VALUE=LAST_VALUE+1
    where COUNTER_NAME=@MeetingCounterName
    select @MeetingCounter=LAST_VALUE from Counter
    where COUNTER_NAME=@MeetingCounterName
    end
    select convert(varchar,datepart(yy,getdate()))+convert(varchar,@MeetingCounter)
  4. Click Execute.

See Also

Setting up Events Advanced Features

Events Advanced Features window

To set up event and function name calculations


ASI logo 10.6 Production Release. Updated 10/5/2005 3:27:31 PM
© Copyright by Advanced Solutions International, Inc. All rights reserved.